package com.cw.base.jeeyc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.cw.base.common.model.dto.response.CommonRespDto;
import com.cw.base.jeeyc.sys.dto.SysExceptionTradeDto;
import com.cw.base.jeeyc.sys.intf.SysExceptionTradeApi;
import com.cw.base.jeeyc.biz.intf.SysExceptionTradeBiz;

/**
 * 异常登记接口层
 *
 * @author admin
 * @date 2020-08-02 12:07:20
 */
@RestController
@RequestMapping("/v1/sysExceptionTrade")
public class SysExceptionTradeApiImpl implements SysExceptionTradeApi {
    @Autowired
    private SysExceptionTradeBiz sysExceptionTradeBiz;
    /**
     * 新增异常登记
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<Boolean> addSysExceptionTrade(@RequestBody SysExceptionTradeDto request) {
        return CommonRespDto.<Boolean>builder().data(
            sysExceptionTradeBiz.addSysExceptionTrade(request)).build();
    }

    /**
     * 更新异常登记
     *
     * @param request 条件
     * @return String
     */
    @Override
    public CommonRespDto<Boolean> modifySysExceptionTrade(@RequestBody SysExceptionTradeDto request) {
        return CommonRespDto.<Boolean>builder().data(
            sysExceptionTradeBiz.modifySysExceptionTrade(request)).build();
    }

    /**
     * 删除异常登记
     *
     * @param request 条件
     * @return boolean
     */
    @Override
    public CommonRespDto<Boolean> deleteSysExceptionTrade(@RequestBody SysExceptionTradeDto request) {
        return CommonRespDto.<Boolean>builder().data(sysExceptionTradeBiz.deleteSysExceptionTrade(request)).build();
    }
}
